import { defineComponent, ref } from 'vue'
import STable from '@surely-vue/table'

export default defineComponent({
  name: 'STable',
  setup() {
    const columns = [
      {
        title: '姓名',
        dataIndex: 'name'
      },
      {
        title: '年龄',
        dataIndex: 'age'
      }
    ]
    const data = ref([
      { name: '用户1', age: 10 },
      { name: '用户2', age: 20 }
    ])
    /* render 函数 */
    return () => {
      return (
        <div>
          <STable
            rowKey="name"
            columns={columns}
            data-source={data.value}></STable>
        </div>
      )
    }
  }
})
